package com.ruoyi.system.api.factory;

import com.ruoyi.system.api.RemoteMessageService;
import com.ruoyi.system.api.domain.SysMessage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;

/**
 * @author sss
 * @description 工单管理服务降级
 * @date 2022/7/27
 */
public class RemoteMessageFallbackFactory implements FallbackFactory<RemoteMessageService> {
    private static final Logger log = LoggerFactory.getLogger(RemoteMessageFallbackFactory.class);

    @Override
    public RemoteMessageService create(Throwable throwable) {
        log.error("创建站内信失败:{}", throwable.getMessage());
        return new RemoteMessageService() {
            @Override
            public String add(SysMessage sysMessage) {
                return null;
            }
        };
    }
}
